<?php if(!defined("HDPHP_PATH"))exit;C("SHOW_NOTICE",FALSE);?><!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
    <title>属性管理</title>
    <script type='text/javascript' src='http://localhost/hdcms/hd/HDPHP/hdphp/Extend/Org/Jquery/jquery-1.8.2.min.js'></script>
<link href='http://localhost/hdcms/hd/HDPHP/hdphp/../hdjs/css/hdjs.css' rel='stylesheet' media='screen'>
<script src='http://localhost/hdcms/hd/HDPHP/hdphp/../hdjs/js/hdjs.js'></script>
<script src='http://localhost/hdcms/hd/HDPHP/hdphp/../hdjs/js/slide.js'></script>
<script src='http://localhost/hdcms/hd/HDPHP/hdphp/../hdjs/org/cal/lhgcalendar.min.js'></script>
<script type='text/javascript'>
		HOST = 'http://localhost';
		ROOT = 'http://localhost/hdcms';
		WEB = 'http://localhost/hdcms/index.php';
		URL = 'http://localhost/hdcms/index.php?g=Hdcms&a=Admin&c=Flag&m=index&mid=1&_=0.48113973121520914';
		HDPHP = 'http://localhost/hdcms/hd/HDPHP/hdphp';
		HDPHPDATA = 'http://localhost/hdcms/hd/HDPHP/hdphp/Data';
		HDPHPTPL = 'http://localhost/hdcms/hd/HDPHP/hdphp/Lib/Tpl';
		HDPHPEXTEND = 'http://localhost/hdcms/hd/HDPHP/hdphp/Extend';
		APP = 'http://localhost/hdcms/index.php?a=Admin';
		CONTROL = 'http://localhost/hdcms/index.php?a=Admin&c=Flag';
		METH = 'http://localhost/hdcms/index.php?a=Admin&c=Flag&m=index';
		GROUP = 'http://localhost/hdcms/hd';
		TPL = 'http://localhost/hdcms/hd/Hdcms/Admin/Tpl';
		CONTROLTPL = 'http://localhost/hdcms/hd/Hdcms/Admin/Tpl/Flag';
		STATIC = 'http://localhost/hdcms/Static';
		PUBLIC = 'http://localhost/hdcms/hd/Hdcms/Admin/Tpl/Public';
		HISTORY = 'http://localhost/hdcms/index.php?a=Admin';
		HTTPREFERER = 'http://localhost/hdcms/index.php?a=Admin';
</script>
    <link type="text/css" rel="stylesheet" href="http://localhost/hdcms/hd/Hdcms/Admin/Tpl/Flag/css/css.css"/>
</head>
<body>
<div class="wrap">
	<form id="search" class="hd-form" onsubmit="return false;">
        <div class="search" id="search">
            模型：
            <select name="mid" class="w100">
                <?php $hd["list"]["m"]["total"]=0;if(isset($model) && !empty($model)):$_id_m=0;$_index_m=0;$lastm=min(1000,count($model));
$hd["list"]["m"]["first"]=true;
$hd["list"]["m"]["last"]=false;
$_total_m=ceil($lastm/1);$hd["list"]["m"]["total"]=$_total_m;
$_data_m = array_slice($model,0,$lastm);
if(count($_data_m)==0):echo "";
else:
foreach($_data_m as $key=>$m):
if(($_id_m)%1==0):$_id_m++;else:$_id_m++;continue;endif;
$hd["list"]["m"]["index"]=++$_index_m;
if($_index_m>=$_total_m):$hd["list"]["m"]["last"]=true;endif;?>

                <option value="<?php echo $m['mid'];?>" <?php if($_REQUEST['mid'] == $m['mid']){?>selected=''<?php }?>><?php echo $m['model_name'];?></option>
                <?php $hd["list"]["m"]["first"]=false;
endforeach;
endif;
else:
echo "";
endif;?>
            </select>
        </div>
    </form>
    <script>
        $("[name='mid'").change(function(){
        	var mid = $(this).val();
           location.href="<?php echo U('index');?>&mid="+mid;
        })
    </script>
    <div class="menu_list">
        <ul>
            <li><a href="javascript:;" class="action">属性管理</a></li>
            <li><a href="<?php echo U('add',array('mid'=>$_REQUEST['mid']));?>">添加属性</a></li>
            <li><a href="javascript:hd_ajax('<?php echo U(updateCache);?>',{mid:<?php echo $_REQUEST['mid'];?>})">更新缓存</a></li>
        </ul>
    </div>
    <form action="<?php echo U('edit');?>" method="post" id="edit_form" class="hd-form" onsubmit="return hd_submit(this);">
    	<input type="hidden" name="mid" value="<?php echo $_REQUEST['mid'];?>" />
        <table class="table2">
            <thead>
            <tr>
                <td class="w30">fid</td>
                <td>属性名称</td>
                <td width="50">操作</td>
            </tr>
            </thead>
            <tbody>
            <?php $hd["list"]["name"]["total"]=0;if(isset($flag) && !empty($flag)):$_id_name=0;$_index_name=0;$lastname=min(1000,count($flag));
$hd["list"]["name"]["first"]=true;
$hd["list"]["name"]["last"]=false;
$_total_name=ceil($lastname/1);$hd["list"]["name"]["total"]=$_total_name;
$_data_name = array_slice($flag,0,$lastname);
if(count($_data_name)==0):echo "";
else:
foreach($_data_name as $key=>$name):
if(($_id_name)%1==0):$_id_name++;else:$_id_name++;continue;endif;
$hd["list"]["name"]["index"]=++$_index_name;
if($_index_name>=$_total_name):$hd["list"]["name"]["last"]=true;endif;?>

                <tr>
                    <td class="w100">
                        <?php echo $name;?>
                    </td>
                    <td>
                        <input type="text" name="flag[]" value="<?php echo $name;?>"/>
                    </td>
                    <td>
                            <a href="javascript:;"
                               onclick="if(confirm('确定要删除属性吗？'))hd_ajax('<?php echo U(del);?>',{mid:<?php echo $_GET['mid'];?>,number:<?php echo $hd['list']['name']['index'] - 1; ?>})">删除
                               </a>
                    </td>
                </tr>
            <?php $hd["list"]["name"]["first"]=false;
endforeach;
endif;
else:
echo "";
endif;?>
            </tbody>
        </table>
        <div class="position-bottom">
            <input type="submit" class="hd-success" id="updateSort" value="修改"/>
        </div>
    </form>
</div>
</body>
</html>